﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Xml.Serialization;

namespace NetRosApp.FinPart.Entities
{

    [Serializable]
    [XmlRoot("FilterLista", IsNullable = false)]
    public class FilterList : List<Filter>

    {
        //public FilterList()
        //{
        //}
    }


    [Serializable]
    [ToolboxItem("Filter")]
    [XmlRootAttribute("Filter", IsNullable = false)]
    public class Filter : IComparable<Filter>
    {
        private string _tip;
        private string _vrijednost;
        private string _Kolumn;
        public Filter()
        {
            _tip = null;
            _vrijednost = null;
        }

        public Filter(string _Kolumn,string _tip, string _vrijednost)
        {
            Tip = _tip;
            Vrijednost = _vrijednost;
            Kolumn = _Kolumn;
        }
        [DescriptionAttribute(""), Bindable(BindableSupport.Yes)]
        [XmlElementAttribute("Tip")]
        public string Tip
        {
            get { return _tip; }
            set { _tip = value; }
        }
        [XmlElementAttribute("Kolumn")]
        public string Kolumn
        {
            get { return _Kolumn; }
            set { _Kolumn = value; }
        }
        [DescriptionAttribute(""), Bindable(BindableSupport.Yes)]
        [XmlElementAttribute("Vrijed")]
        public string Vrijednost
        {
            get { return _vrijednost; }
            set { _vrijednost = value; }
        }


        #region IComparable<Filter> Members

        public int CompareTo(Filter other)
        {
            return Kolumn.CompareTo(other.Kolumn);
        }

        #endregion
    }
}
